function [transmittedBit, outputBit] = Qd
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
clc;
%Set up parameters to generate transmitted bit
I = 0.6;
U = rand;

%generate transmit bit
if U<=I
    transmittedBit = 0;
else
    transmittedBit = 1;
end


% disp(['Transmitted bit:' num2str(TX)]);

%simulate line

%simulate erasure
I = 0.2;
J = 0.25;
U = rand;

if U<=I
    outputBit = '?';
elseif U>I && U<=J
        if transmittedBit == 0
            outputBit = 1;
        else
            outputBit = 0;
        end
    else
        outputBit = transmittedBit;
    
end



% disp(['Received bit:' num2str(RX)]);
end

